using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_Home : admin_BaseUserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        User user = Session["user"] as User;
        if (user == null) Response.Redirect("../pages/Default.aspx");
        if (user.Id <=0) Response.Redirect("../pages/Default.aspx");
        if (!IsPersolnel) Response.Redirect("Default.aspx?ctrl=profile&id="+user.Id.ToString());
        int y = DateTime.Today.Year;
        int m = DateTime.Today.Month;
        int d = DateTime.Today.Day;
        BookingDAO daoBooking = new BookingDAO();
        FeedbackDAO daoFeedback = new FeedbackDAO();
        TourDAO daoTour = new TourDAO();
        FacilityDAO daoFacility = new FacilityDAO();
        lblBookingToday.Text = daoBooking.GetBookingCountByDate(DateTime.Today).ToString(); 
      
        lblMonthBooking.Text = daoBooking.GetBookingCountByMonth(DateTime.Today).ToString();
        lblTodayFeedback.Text=daoFeedback.GetFeedbackCount(new DateTime(y,m,d,0,0,0),new DateTime(y,m,d,23,59,59)).ToString();
        lblTourNumber.Text = daoTour.GetTourCount().ToString();
        lblFacilityNumber.Text = daoFacility.GetFacilityCount().ToString();
    }
}
